<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>颜色</title>
    <style>
        html, body {
            width: 100%;
            height: 100%;
        }

        body {
            margin: 0;
            padding: 0;
            background: url(images/bg.jpg);
        }

        .mask {
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, .4);
            position: relative;
        }

        .login {
            width: 300px;
            height: 300px;
            background-color: #fff;
            border-radius: 10px;
            margin: 0 auto;
            position: absolute;
            top:50%;
            left:50%;
            margin-left: -150px;
            margin-top: -150px;
        }
    </style>
</head>
<body>
<!--颜色的表达方式 red   rgb #123-->
<!--透明度  opacity transparent  filter-->
<div class="mask">
    <div class="login"></div>
</div>
</body>
</html>